/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package UI;

import BL.Usuario;

/**
 *
 * @author carlos saborio
 */
public class MenuPrincipla extends javax.swing.JFrame {

    private Usuario user;
    public static String name;
    public MenuPrincipla(Usuario t) {
        initComponents();
        this.setLocationRelativeTo(null);
        user=t;
        this.lblUsuario.setText(t.getNombre());
    }

    public void cargandoNombre(String name){
        this.lblUsuario.setText(name);
    }
    
    public void setUser(Usuario u){this.user=u;}
    public Usuario getUser(){return this.user;}
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        lblUsuario = new javax.swing.JLabel();
        btnMantenimiento = new org.edisoncor.gui.button.ButtonIcon();
        btnBusquedaAvaluos = new org.edisoncor.gui.button.ButtonIcon();
        btnInsertarAvaluos = new org.edisoncor.gui.button.ButtonIcon();
        btnInsertarUsuario = new org.edisoncor.gui.button.ButtonIcon();
        btnMantenimientoAvaluos = new org.edisoncor.gui.button.ButtonIcon();
        lblInfoUsuario = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Menú Principal");
        setBackground(new java.awt.Color(255, 255, 255));

        jLabel4.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        jLabel4.setText("Registro de Avaluos");

        jLabel5.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        jLabel5.setText("Busqueda de Avaluos");

        jLabel7.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        jLabel7.setText("Registro de Usuario");

        jLabel11.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        jLabel11.setText("Mantenimiento del Sistema");

        jLabel13.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        jLabel13.setText("Mantenimiento de Avaluos");

        jPanel2.setBackground(new java.awt.Color(108, 131, 177));
        jPanel2.setForeground(new java.awt.Color(0, 102, 153));

        jLabel22.setFont(new java.awt.Font("Cambria", 3, 24)); // NOI18N
        jLabel22.setForeground(new java.awt.Color(255, 255, 255));
        jLabel22.setText("Menú Principal");

        lblUsuario.setFont(new java.awt.Font("Cambria", 0, 14)); // NOI18N
        lblUsuario.setForeground(new java.awt.Color(255, 255, 255));
        lblUsuario.setText(" ");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(307, Short.MAX_VALUE)
                .addComponent(jLabel22)
                .addGap(63, 63, 63)
                .addComponent(lblUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 183, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jLabel22)
                .addContainerGap(22, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lblUsuario)
                .addContainerGap())
        );

        btnMantenimiento.setBackground(new java.awt.Color(255, 255, 255));
        btnMantenimiento.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/carrepair-garaje-herramientas-clave-de-mantenimiento-de-cabeza-plana-icono-4488-128.png"))); // NOI18N
        btnMantenimiento.setText("buttonIcon1");

        btnBusquedaAvaluos.setBackground(new java.awt.Color(255, 255, 255));
        btnBusquedaAvaluos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/los-registros-de-auroras-busquedas-texto-icono-5086-128.png"))); // NOI18N
        btnBusquedaAvaluos.setText("buttonIcon1");

        btnInsertarAvaluos.setBackground(new java.awt.Color(255, 255, 255));
        btnInsertarAvaluos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/cajon-del-gabinete-icono-4498-128.png"))); // NOI18N
        btnInsertarAvaluos.setText("buttonIcon1");
        btnInsertarAvaluos.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInsertarAvaluosActionPerformed(evt);
            }
        });

        btnInsertarUsuario.setBackground(new java.awt.Color(255, 255, 255));
        btnInsertarUsuario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/los-usuarios-de-foro-de-la-familia-icono-4429-128.png"))); // NOI18N
        btnInsertarUsuario.setText("buttonIcon1");
        btnInsertarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInsertarUsuarioActionPerformed(evt);
            }
        });

        btnMantenimientoAvaluos.setBackground(new java.awt.Color(255, 255, 255));
        btnMantenimientoAvaluos.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/MA.png"))); // NOI18N
        btnMantenimientoAvaluos.setText("buttonIcon1");

        lblInfoUsuario.setFont(new java.awt.Font("Cambria", 3, 14)); // NOI18N
        lblInfoUsuario.setText("Acerca del usuario..");
        lblInfoUsuario.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lblInfoUsuarioMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lblInfoUsuarioMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lblInfoUsuarioMouseExited(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(188, 188, 188)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnInsertarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(102, 102, 102)
                        .addComponent(btnMantenimientoAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(93, 93, 93)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(lblInfoUsuario)))
                .addContainerGap())
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addGap(80, 80, 80)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnInsertarAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(95, 95, 95)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnBusquedaAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 76, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btnMantenimiento, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(79, 79, 79))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(48, 48, 48))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 43, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnInsertarAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnBusquedaAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btnMantenimiento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel11)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 30, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btnInsertarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnMantenimientoAvaluos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(jLabel13))
                        .addGap(20, 20, 20))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(lblInfoUsuario)
                        .addContainerGap())))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnInsertarAvaluosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertarAvaluosActionPerformed
        new UIAvaluos().setVisible(true);
    }//GEN-LAST:event_btnInsertarAvaluosActionPerformed

    private void btnInsertarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertarUsuarioActionPerformed
        new IngresoUsuarios().setVisible(true);
    }//GEN-LAST:event_btnInsertarUsuarioActionPerformed

    private void lblInfoUsuarioMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblInfoUsuarioMouseEntered
        this.lblInfoUsuario.setForeground(java.awt.Color.BLUE);
    }//GEN-LAST:event_lblInfoUsuarioMouseEntered

    private void lblInfoUsuarioMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblInfoUsuarioMouseExited
       this.lblInfoUsuario.setForeground(java.awt.Color.BLACK);
    }//GEN-LAST:event_lblInfoUsuarioMouseExited

    private void lblInfoUsuarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblInfoUsuarioMouseClicked
        CambiosCuenta cam=new CambiosCuenta(this,true,this.user,this.lblUsuario);
        cam.setVisible(true);
        
        
                
    }//GEN-LAST:event_lblInfoUsuarioMouseClicked

    
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.edisoncor.gui.button.ButtonIcon btnBusquedaAvaluos;
    private org.edisoncor.gui.button.ButtonIcon btnInsertarAvaluos;
    private org.edisoncor.gui.button.ButtonIcon btnInsertarUsuario;
    private org.edisoncor.gui.button.ButtonIcon btnMantenimiento;
    private org.edisoncor.gui.button.ButtonIcon btnMantenimientoAvaluos;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel lblInfoUsuario;
    private javax.swing.JLabel lblUsuario;
    // End of variables declaration//GEN-END:variables
}
